<template>
  <div>类目：{{ id }}</div>
</template>

<script>
import { watch } from 'vue'
import { useRoute } from 'vue-router'
export default {
  setup () {
    const route = useRoute()
    const id = route.params.id
    watch(
      () => route.params.id,
      (newVal, oldVal) => {
        console.log(newVal, oldVal)
      },
      {
        deep: true,
        immediate: true
      }
    )
    return { id }
  }
}
</script>

<style></style>
